﻿Imports MadMilkman

Public Class frmDropBox
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If (FolderBrowserDialog1.ShowDialog() = DialogResult.OK) Then
            TextBox1.Text = FolderBrowserDialog1.SelectedPath
        End If
    End Sub

    Private Sub frmDropBox_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim file As New MadMilkman.Ini.IniFile

        Dim P As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
        P = New Uri(P).LocalPath
        file.Load(P & "/config.ini.txt")
        Dim sec As MadMilkman.Ini.IniSection
        sec = file.Sections(0)
        TextBox1.Text = sec.Keys(0).Value
        Dim b As String
        b = ""

    End Sub

    Private Sub frmDropBox_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed

        'Guardar
        Dim file As New MadMilkman.Ini.IniFile
        Dim P As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
        P = New Uri(P).LocalPath
        file.Load(P & "/config.ini.txt")
        Dim sec As MadMilkman.Ini.IniSection
        sec = file.Sections(0)
        sec.Keys(0).Value = TextBox1.Text
        file.Save(P & "/config.ini.txt")

        'Recargar
        frmMain.iniciar(TextBox1.Text)


    End Sub
End Class